
-- for 
local num = 0
for i=1,5 do -- 从1到5 循环5次
	if i == 4 then break end
	num =num+1
end
print(num)
assert(num==3)

local num = 0
for i=1,5,2 do -- 跳2，循环3次
	num =num+1
end
assert(num==3)

-- repeat ，循环5次
local num = 0
repeat 
	num = num+1
until num == 5
assert(num == 5)

-- while ，循环10次
local num = 0
while num < 10 do
	num = num + 1
end
assert(num == 10)

t = {}
for i=5,10 do -- 从5到10 循环6次
	table.insert(t,'value'..i);
end

for idx,value in pairs(t) do
	print(idx,"-->",value)
end

